home *** CD-ROM | disk | FTP | other *** search
- //
- // Demonstration of a squirming blob shape
- //
- // Polyray input file - Alexander Enzmann
- //
-
- // Define the range of the animation
- start_frame 0
- end_frame 119
- total_frames 120
- outfile sqrm
-
- // Set up the camera
- viewpoint {
- from <0,3,-20>
- at <0,0,0>
- up <0,1,0>
- angle 45
- resolution 160, 160
- }
-
- // Set up background color & lights
- background midnightblue
- light <-10,20,-50>
- light < 10,20,-50>
-
- define shiny_red
- texture {
- surface {
- ambient red, 0.2
- diffuse red, 0.6
- specular white, 0.8
- microfacet Reitz 10
- }
- }
-
- // Give the (time dependent) location of the blob points
- define ang radians(6 * frame)
- define squirm_thresh 0.15
-
- // The values of r and s are used to define how far each of the pieces of the
- // blob move and how fast they move respectively.
- define r10 1
- define r11 1
- define r20 2
- define r21 1
- define r30 2
- define r31 3
- define r40 3
- define r41 4
- define r50 4
- define r51 1
- define r60 1
- define r61 3
- define r70 2
- define r71 2
- define r80 3
- define r81 5
-
- define s1 3
- define s2 2
- define s3 1.5
- define s4 1
- define s5 3
- define s6 2
- define s7 1.5
- define s8 1
- define s09 2
- define s10 1.5
- define s11 3
- define s12 1.5
- define s13 2
- define s14 3
- define s15 2
- define s16 1.5
- define s17 1
-
- define r09x 3
- define r09y 2
- define r09z 1
- define r10x 1
- define r10y 2
- define r10z 1
- define r11x 2
- define r11y 0.5
- define r11z 3
- define r12x 5
- define r12y 0
- define r12z 0
- define r13x 3
- define r13y 3
- define r13z 3
- define r14x 4
- define r14y 0
- define r14z 1
- define r15x 0
- define r15y 0
- define r15z 4
- define r16x 0
- define r16y 3
- define r16z 0.5
-
- // Define some offset angles - this way the blob pieces won't all be lined
- // up when the animation starts.
- define o09 radians(0)
- define o10 radians(192)
- define o11 radians(15)
- define o12 radians(20)
- define o13 radians(117)
- define o14 radians(300)
- define o15 radians(270)
- define o16 radians(90)
-
- //
- // Define the positions of the various component parts of the blob, by using
- // The values defined above, we have each of the 16 blob compoents moving in
- // independent circles, ellipses, and line.
- //
- define loc1 < r10 * cos(s1*ang), 0, r11 * sin(s1*ang)>
- define loc2 < r20 * cos(s2*ang), 0, r21 * sin(s2*ang)>
- define loc3 < r30 * cos(s3*ang), 0, r31 * sin(s3*ang)>
- define loc4 < r40 * cos(s4*ang), 0, r41 * sin(s4*ang)>
- define loc5 < r50 * cos(s5*ang), r51 * sin(s5*ang), 0>
- define loc6 < r60 * cos(s6*ang), r61 * sin(s6*ang), 0>
- define loc7 < r70 * cos(s7*ang), r71 * sin(s7*ang), 0>
- define loc8 < r80 * cos(s8*ang), r81 * sin(s8*ang), 0>
-
- define loc09 <r09x*cos(s09*ang+o09),r09y*cos(s09*ang+o09),r09z*cos(s09*ang+o09)>
- define loc10 <r10x*cos(s10*ang+o10),r10y*cos(s10*ang+o10),r10z*cos(s10*ang+o10)>
- define loc11 <r11x*cos(s11*ang+o11),r11y*cos(s11*ang+o11),r11z*cos(s11*ang+o12)>
- define loc12 <r12x*cos(s12*ang+o12),r12y*cos(s12*ang+o12),r12z*cos(s12*ang+o12)>
- define loc13 <r13x*cos(s13*ang+o13),r13y*cos(s13*ang+o13),r13z*cos(s13*ang+o13)>
- define loc14 <r14x*cos(s14*ang+o14),r14y*cos(s14*ang+o14),r14z*cos(s14*ang+o14)>
- define loc15 <r15x*cos(s15*ang+o15),r15y*cos(s15*ang+o15),r15z*cos(s15*ang+o15)>
- define loc16 <r16x*cos(s16*ang+o16),r16y*cos(s16*ang+o16),r16z*cos(s16*ang+o16)>
-
- // And finally we build the blob shape.
- object {
- blob squirm_thresh:
- sphere loc1, 0.2, 3.0,
- sphere loc2, 0.2, 3.0,
- sphere loc3, 0.2, 3.0,
- sphere loc4, 0.2, 3.0,
- sphere loc5, 0.2, 3.0,
- sphere loc6, 0.2, 3.0,
- sphere loc7, 0.2, 3.0,
- sphere loc8, 0.2, 3.0,
- sphere loc09, 0.2, 3.0,
- sphere loc10, 0.2, 3.0,
- sphere loc11, 0.2, 3.0,
- sphere loc12, 0.2, 3.0,
- sphere loc13, 0.2, 3.0,
- sphere loc14, 0.2, 3.0,
- sphere loc15, 0.2, 3.0,
- sphere loc16, 0.2, 3.0
- uv_steps 20, 20
- shiny_red
- }
-